An air-fuel ratio sensor which uses zirconia solid electrolyte as a sensor element is known. The sensor element detects current that changes in response to the concentration of oxygen in an exhaust gas. This air-fuel ratio sensor does not operate if the temperature of the sensor element is not maintained at approximately 650.degree. C. to 750.degree. C. Therefore, the air-fuel ratio sensor has a heater, which, for example, has platinum electrodes, to maintain the temperature of the sensor element at 650.degree. C. to 750.degree. C. In the air-fuel ratio sensor having a heater, the temperature of the sensor element can be increased by supplying a higher electric power to the heater. If the electric power supply to the heater is controlled, the temperature of the sensor element can be controlled.
As the air-fuel ratio sensor is arranged in an exhaust pipe, the air-fuel ratio sensor is heated not only by the heater but also by the exhaust gas and radiant heat from the engine body including the exhaust pipe. Therefore, the temperature of the sensor element is influenced not only by the temperature of the heater but also by the exhaust gas and the engine body. Accordingly, in a light load engine condition, in which the temperatures of both exhaust gas and the engine body are low, the electric power supply to the heater must be increased to maintain the temperature of the sensor element at 650.degree. C. to 750.degree. C. On the other hand, in a heavy load engine condition in which the temperatures of both exhaust gas and the engine body are high, the electric power supply to the heater must be decreased to maintain the temperature. The electric power supply to the heater necessary for maintaining the temperature of the sensor element at 650.degree. C. to 750.degree. C., is empirically measured depending on engine operating conditions, and the measured data are memorized as basic electric power supply data. Then, the temperature of the sensor element is controlled to 650.degree. C. to 750.degree. C., by heating the heater in accordance with the basic electric power supply depending on the engine operating conditions.
The heater having the platinum electrodes, on the other hand, is deteriorated when it is kept for a long time at high temperature, for example, at 1120.degree. C. or more. Therefore, the basic power supply is controlled so that the heater temperature does not exceed 1100.degree. C. At the engine start up time, it is necessary to maintain the temperature of the heater as high as possible. At this time, however, it is necessary to increase the temperature of the sensor element to 650.degree. to 750.degree. C. as quickly as possible. Therefore, the basic power supply is determined so that the temperature of the heater reaches 1100.degree. C. at the engine start up time. Furthermore, it is also necessary to maintain the temperature of the heater in the light load engine condition.
As explained above, the basic power supply is set to low at the heavy load engine condition, and set to high at the light load engine condition, so that the power supply is rapidly increased when the engine condition is changed from the heavy load to the light load. However, for a period of time after changing the engine condition from heavy load to light load, the temperature of the sensor element is maintained at a high level by the radiant heat from the engine body since the temperature of the engine body is kept high. Therefore, the temperature of the heater is kept over 1120.degree. C. for a long time after the engine condition is changed from heavy load to light load because the power supply rapidly increases in response to the change in engine condition form heavy load to light load. This results in damage to the heater and the sensor element.
The electrical resistance is proportional to the temperature of the heater. Therefore, the temperature of the heater can be determined from the resistance. To solve the above mentioned problem, Japanese Unexamined Patent Publication No. 1-158335 has proposed a heater controller that measures the resistance of the heater and reduces the basic power supply for a period after the engine condition is changed from heavy load to light load and when the resistance of the heater exceeds the limit resistance of the heater at, for example, 1100.degree. C.
However, according to the heater controller disclosed in Japanese Unexamined Patent Publication No. 1-158335, the power supply to the heater is reduced when the engine condition is changed from heavy load to light load before the engine is fully warmed up or when the resistance of the heater is mismeasured as the resistance of the heater exceeds the limit resistance, which results in decreasing the temperature of the air-fuel ratio sensor to an inactivated state thereof. Once the temperature of the sensor element is reduced, the air-fuel ratio feedback control cannot be used until the air-fuel ratio sensor is reactivated. This results in a failure to clean the exhaust gas. To solve this problem, Japanese Unexamined Patent Publication No. 3-223664 has proposed a heater controller that sets a predetermined period after the engine condition is changed from heavy load to light load depending on the engine warm up condition. The period under the condition when the engine is not yet warmed up, is set shorter than the period when the engine is warmed up. Thus, the basic power supply can be set relatively high. However, the heater controller disclosed in Japanese Unexamined Patent Publication No. 3-223664 records the limit resistance of the heater under the light load engine condition. Therefore, this heater controller cannot supply more electric power, to the heater, than the recorded value, at the engine start up time when the current resistance is lower than the upper limit resistance of the heater because the basic power supply is set such that the resistance of the heater may not exceed the upper limit resistance which was obtained when it was recorded, as explained before. As a result, it takes a long time to heat the air-fuel ratio sensor until it is activated.
Furthermore, the heater controller above prevents the heater and the sensor element from deteriorating by setting the limit resistance as an upper limit of the heater. On the other hand, the heater and the sensor element are at high temperature when the engine condition is changed from heavy load to light load after the engine is warmed up. At this time, if the basic power supply is supplied to heat the heater in accordance with the light load engine condition up to the upper limit, the heater is further warmed up by the exhaust gas and radiant heat from the engine body. As a result, the heater and the sensor element are overheated and are deteriorated. Therefore, the upper limit has to be set low. On the contrary, the air-fuel ratio feedback control of the engine must be started as early as possible after the engine start up to clean the exhaust gas. For this reason, the sensor element has to be activated as early as possible. Therefore, the upper limit has to be set high. These requirements contradict one another.